<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="k" uri="/WEB-INF/k.tld"%>
<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>销售单号查询(注:这里只能查询前15天可退货的商品,超出范围可在销售记录查询页面查询)</title>
		<jsp:include page="../inc.jsp"></jsp:include>
		<script type="text/javascript" src="../My97DatePicker/WdatePicker.js"></script>
		<link href="../web/css/style.css" rel="stylesheet" type="text/css" />
		<SCRIPT language="JavaScript" type="text/javascript" src="../web/js/hdm.js"></SCRIPT>
		<SCRIPT>
		var datagrid;
		var lastIndex;
		$(function(){
			datagrid = $('#datagrid').datagrid({
				url : '${pageContext.request.contextPath}/xsgl/saleReturnlistAction!noAuth_searcheReturn.html',
				title : '销售列表',
				iconCls : 'icon-save',
				pagination : true,
				pagePosition : 'bottom',
				pageSize : 10,
				pageList : [ 10, 20, 30, 40 ],
				fit : true,
				fitColumns : false,
				nowrap : false,
				border : false,
				idField : 'id',
				sortName : 'date',
				sortOrder : 'desc',
				checkOnSelect : false,
				selectOnCheck : false,
				singleSelect : true,
				columns : [ [  {
					title : '日期',
					field : 'date',
					width : 130,
					align:'center'
				},{
					title : '商品条码',
					field : 'barcode',
					width : 120,
					align:'center'
				},{
					title : '商品款号',
					field : 'type',
					width : 90,
					align:'center'
				},{
					title : '商品名称',
					field : 'name',
					width : 100,
					align:'center'
				},{
					title : '商品颜色',
					field : 'color',
					width : 60,
					align:'center'
				},{
					title : '商品尺码',
					field : 'size',
					width : 60,
					align:'center'
				}, {
					title : '销售单号',
					field : 'serial',
					width : 140,
					align:'center'
				},{
					title : '出货仓库',
					field : 'rid',
					width : 80,
					align:'center',
					hidden : true
				},{
					title : '出货仓库',
					field : 'rname',
					width : 80,
					align:'center'
				},{
					title : '会员姓名',
					field : 'mname',
					width : 70,
					align:'center'
				}] ],onDblClickRow: function(index,data){
					var rows = $('#datagrid').datagrid('getSelections');
					var id = rows[0].serial+","+rows[0].rid;
					var vv = id.split(","); 
					window.returnValue=vv;
					//alert("ok");
					//调用父窗体中的autoInput 方法
					//opener.autoInput();
					window.close();
				}
			});
			
			var rid0 = $('#searchForm').find('input[name=rid]');
			var rid0Combobox = rid0.combobox({
			url : '${pageContext.request.contextPath}/rkgl/repertoryAction!noAuth_combobox.html',
			valueField : 'id',
			textField : 'name',
			multiple : false,
			editable : false,
			onLoadSuccess : function() {
 			var sa = '${sessionInfo.repertoryIds}';
 				if(sa!='null'&&sa!='undefinded'&&sa!=null){ 
 				   rid0.combobox('setValue','${sessionInfo.repertoryIds}');
 				}
				parent.$.messager.progress('close');
			}
			});
		});


		function _search() {
			datagrid.datagrid('load', sy.serializeObject($('#searchForm')));
		}
		
		function cleanSearch() {
			datagrid.datagrid('load', {});
			$('#searchForm input').val(''); 
			$("#rid").val('');
			$("#uid").val('');
			_search();
		}
		
	
		
		</SCRIPT>
	</head>

	<body>
	<div class="cont">
		<div style="height: 100px; overflow: hidden;">
			<form id="searchForm">
				<table  style="width: 100%; height: 100%;">
					<tr>
						<th>会员手机</th>
						<td><input name="mobile" style="width: 150px;"  class="input1"/></td>
						<th>会员姓名</th>
						<td><input name="mname" style="width: 150px;"  class="input1"/></td>
					</tr> 
					<tr>
						<th>所属仓库</th>
						<td>
							<input name="rid" style="width: 150px;" />
						</td> 
						<th>商品款号</th>
						<td><input name="gtype" style="width: 150px;"  class="input1"/></td>
					</tr>
					<tr>
					<td colspan="4" style="text-align:center">
							<a href="javascript:void(0);" class="easyui-linkbutton" 
								onclick="_search();">搜索</a><a href="javascript:void(0);"
								class="easyui-linkbutton" onclick="cleanSearch();">取消</a>
						</td>
					</tr>
				</table>
			</form>
		</div>
		<div style="overflow: hidden;height:460px;">
			<table id="datagrid"></table>
		</div>
	</div> 
	</body>
</html>
